<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/views/include/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ include file="/views/include/nocachehead.jsp"%>
<%@ include file="/views/include/statusbar.jsp"%>
<title>${spotInfo.name}</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/payattention.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/pagination.js"></script>

<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/comment.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.raty.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/stringutil.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/base.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/feed.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/shortMessage.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/notification.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/video.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/ratyStar.js"></script>
</head>
<script type="text/javascript">

$(document).ready(function(){
//	$('#myStar').starLevel();

//	AjaxstarInit(spotStar,${spotInfo.id},${spotInfo.star});
	//alert($('#content').html().length);
	//showDepart();
});
</script>
<style type="text/css">
.mainBox1 {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 800px;
	width: 700px;
}

.mainBox2 {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 800px;
	width: 260px;
}

.spotView {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 250px;
	width: 250px;
}

.spotStarView {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 50px;
	width: 700px;
}

.spotCharView {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 80px;
	width: 700px;
}

.spotPositionView {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 100px;
	width: 250px;
}

.adminview {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 120px;
	width: 250px;
}

.introductionView {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 100px;
	width: 250px;
}

.fansView {
	border: 0px margin:     3px;
	padding: 0px;
	float: left;
	height: 30px;
	width: 250px;
}

.starclass {
	font: 10px verdana;
}

#bodyDiv {
	position: relative;
	top: 42px;
	width: 960px;
	min-height: 500px;
	height: auto !important;
	margin: 0 auto;
}

#woOwnerDiv {
	float: right;
	width: 240px;
	height: 500px;
	background: #ffff;
	left: 10px;
}

#content {
	float: left;
	width: 720px;
	min-height: 500px;
	background: #ffff;
}

hr {
	boder: 1px dashed #cccccc;
}
</style>
<script type="text/javascript">
MyNewsDivChoose={
		shortMessage:function()
		{
			$("#shortMessageDiv").css("display","block");
			$("#photoDiv").css("display","none");
			$("#videoDiv").css("display","none");
		},
		photo:function()
		{
			$("#shortMessageDiv").css("display","none");
			$("#photoDiv").css("display","block");
			$("#videoDiv").css("display","none");
		},
		video:function()
		{
			$("#shortMessageDiv").css("display","none");
			$("#photoDiv").css("display","none");
			$("#videoDiv").css("display","block");
		}
}

function addSpotChar()
{
	$.ajax({
		url:"/skyline/spot/char/add.html",
		type:"POST",
		data:"ownerId="+${spotInfo.id}+"&charTitle="+$('#spotCharTile').val()+"&charDetail="+$('#spotCharDetail').val(),
		dataType:"json",
		contentType : "application/x-www-form-urlencoded; charset=utf-8",
		success : function(obj) {
			if (obj == null) {
			// ajaxLogin();
			} else{
				if(obj.loginStatus==false){
					$.alerts._hide();	
					ajaxLogin();
				}
				else if(obj.loginStatus==true){
					if(obj.addStaus==false){
						$.alerts._hide();	
						location.reload();
						alert("添加特色失败！");
					}else if(obj.addStaus == true){
						$.alerts._hide();	
						location.reload();
						alert("添加特色成功！");
						}
				}
			}
		}
	});	
}
function support(charId,num)
{
	$.ajax({
		url:"/skyline/spot/char/support.html",
		type:"POST",
		data:"charId="+charId,
		dataType:"json",
		contentType : "application/x-www-form-urlencoded; charset=utf-8",
		success : function(obj) {
			if (obj == null) {
			// ajaxLogin();
			}else{
				if(obj.supportStatus==true){
					alert("谢谢参与");
					num+=1;
					$('a#'+charId).css('background-color','#888888');
					$('a#'+charId).text("已支持("+num+")");
				//	$('a#'+charId).onclick(function(){});
					document.getElementById(charId).onclick='';
				}
					
			}
		}
	});	
}
function tableHide()
{
	$.alerts._hide();	
}
function setCharTable() {
	var charTable = "<table><tr><td>标题:</td><td><input type='text' id='spotCharTile'/></td></tr><tr><td>内容:</td><td><textarea rows='5' cols='30' id='spotCharDetail'></textarea></td></tr><tr><td colspan='2' align='right'><input type='button' onclick='addSpotChar()' value='提交'>&nbsp;<input type='button' onclick='tableHide()' value='取消'>&nbsp;&nbsp;</td></tr></table>";
	jMessageBox(charTable, '添加特色');
}
$(document).ready(function(){
	if(${authority}>=20)
		{
		}else{
			$('a#edit').hide();
		}
	
	
});
</script>
<body onload="Feed.getFeedsInitial(${spotInfo.id});">
	<br>
	<br>
	<div class="mainBox1">
		<div class="spotStarView">
			<a>Rate:</a>
			<skyline:ratyStar startStar="${spotInfo.star }"
				objId="${spotInfo.id }" isBig="true" isReadOnly="false"
				objType="SPOT"></skyline:ratyStar>
			<a id="voteNum">${spotInfo.votes }</a>
		</div>
		<div class="spotCharView">
			<c:choose>
				<c:when test="${spotCharaList eq NULL}">
					<a>该点还没有特色</a>
				</c:when>
				<c:otherwise>
					<c:forEach var="chara" items="${spotCharaList}" begin="0" end="6"
						step="1">
						<div class="charaView">
							<a
								href="${pageContext.request.contextPath}/spot/chara/${spotInfo.id}/${chara.id}.html">
								<c:choose>
									<c:when test="${chara.portrait == 'default' }">
										<img title="${chara.characteristicTitle }" width="20px"
											height="20px"
											src="${pageContext.request.contextPath}/image/head.jpg" />
									</c:when>
									<c:otherwise>
										<img title="${chara.characteristicTitle }" width="20px"
											height="20px" src="${portraitPath }/${chara.portrait}">
									</c:otherwise>
								</c:choose>


							</a> <a> ${char.characteristicTitle}</a>

						</div>
					</c:forEach>
				</c:otherwise>
			</c:choose>
			<a style="color: #0099CC"
				href="${pageContext.request.contextPath}/spot/chara/${spotInfo.id}/add.html">我要添加</a>

		</div>
		<div id="content-tab">
			<div id="feedsDiv"></div>
			<input type="button" value="更多新鲜事"
				onclick="javascript:Feed.getFeeds();" />
		</div>
		<div id="ref-view">
			<c:forEach var="ref" items="${refList}" begin="0" end="4" step="1">
				<a href="${pageContext.request.contextPath}/spot/ref/${ref.spotId}/${ref.id}.html"> <c:choose>
						<c:when test="${ref.refrenceportrait == 'default' }">
							<img title="${ref.refrenceTitle }" width="60px" height="40px"
								src="${pageContext.request.contextPath}/image/head.jpg" />
						</c:when>
						<c:otherwise>
							<img title="${ref.refrenceTitle }" width="60px" height="40px"
								src="${portraitPath }/${ref.refrenceportrait}">>
									</c:otherwise>
					</c:choose>


				</a>
			</c:forEach>
		</div>
		<div id="addref-view">
			<a
				href="${pageContext.request.contextPath}/spot/ref/${spotInfo.id}/photo/new.html">我要投递</a>
		</div>
		<div id="comment-tab">
			<skyline:comment maxSize="10" commentType="SPOT" objId="comment"
				contextPath="${pageContext.request.contextPath}"
				resourceId="${spotInfo.id }" resourceName="${spotInfo.name }"
				ownerId="${spotInfo.administratorId}" />

		</div>
	</div>
	<div class="mainBox2">
		<div class="spotPositionView">
			<a>${spotInfo.name }</a><br> <em>位置：</em> <a class="countryTag"
				href="${pageContext.request.contextPath}/spot/country/${spotInfo.siteId}/list.html">${spotInfo.country}</a>
			<em class="provinceTag">›</em> <a class="provinceTag"
				href="${pageContext.request.contextPath}/spot/province/${spotInfo.siteId}/list.html">${spotInfo.province}</a><em
				class="provinceTag">›</em> <a class="provinceTag"
				href="${pageContext.request.contextPath}/spot/city/${spotInfo.siteId}/list.html">${spotInfo.city}</a><em
				class="detailTag">›</em> <a class="detailTag">${spotInfo.detailAddress}</a><a
				href="${pageContext.request.contextPath}/spot/${spotInfo.id}/map.html">查看地图</a><br>
				<a id="edit"
					href="${pageContext.request.contextPath}/spot/${spotInfo.id}/edit.html">编辑</a>
		</div>
		<div class="spotView">
			<c:choose>
				<c:when test="${spotInfo.portrait == 'default' }">
					<img title="${spotInfo.name }" width="240px" height="240px"
						src="${pageContext.request.contextPath}/image/head.jpg" />
				</c:when>
				<c:otherwise>
					<img title="${spotInfo.name}" width="240px" height="240px"
						src="${portraitPath }/${spotInfo.portrait}" />
				</c:otherwise>
			</c:choose>

		</div>

		<skyline:attention idolPortrait="${spotInfo.portrait}"
			idolNickname="${spotInfo.name}" idolType="SPOT"
			idolId="${spotInfo.id}"></skyline:attention>
		<div id="adminView" class="adminview">
			<a
				href="${pageContext.request.contextPath}/wo/${spotInfo.administratorId}.html">
				<img title="${spotInfo.administratorNickname }"
				src="${portraitPath }/${spotInfo.administratorPortrait}" />
			</a>
		</div>
		<div id="introduction" class="introductionView">
			${spotInfo.introduction }
			<!--  <input type="button" id="switch" value="more" style="display :blocked">-->
		</div>
		<div id="fansView" class="fansView">
			<c:forEach var="fans" items="${fanList}" begin="0" end="6" step="1">
				<a href="${pageContext.request.contextPath}/wo/${fans.fanId}.html">
					<img title="${fans.fanNickname }" width="20px" height="20px"
					src="${portraitPath }/${fans.fanPortrait }">
				</a>
			</c:forEach>
			<c:if test="${fansNum >6 }">
				<a
					href="${pageContext.request.contextPath}/spot/fans/${spotInfo.id}.html">more</a>
			</c:if>

		</div>
	</div>
</body>
</html>